#pragma  once

#include <list>
#include <vector>
#include <math.h>
#include <string>
#include <string.h>

#ifdef WIN32
using namespace std;
#endif

typedef unsigned    char    BYTE;  /* 8-bits  0 to 255*/
typedef	int					INT;
typedef	short				SHORT;
typedef	unsigned short		USHORT;
typedef	unsigned int		UINT;
typedef	long				LONG;
typedef	unsigned long		ULONG;
typedef char IssuerChar[7+1];//发行人类型
typedef char SectorChar[16+1];//行业类型
typedef char AreaChar[16+1];//地区类型
typedef char SubTypeChar[4+1];//债券子类型
typedef char ABSSeriesNameChar[32+1];//ABS系列
typedef char MuniAreaChar[16];//城投地区类型

#define BLH_BONDTYPECOUNT	30 //增加ABS 继续增加二级资本债和熊猫债
#define BLH_ISSUERCOUNT		500
#define BLH_SECTORCOUNT		300
#define BLH_MUNIAREACOUNT	300	//城投地区
#define BLH_AREACOUNT		100
#define BLH_SUBTYPECOUNT	100
#define BLH_DEBTRATECOUNT	10
#define BLH_FINDEBTCOUNT	10
#define BLH_ISSUEYEARCOUNT	50
#define BLH_WARRANTCOUNT	10
#define BLH_LOCALBONDAREACOUNT	40

#define BLH_RATING_OUTLOOK	10

#define BLH_RATING_CHINABOND BLH_DEBTRATECOUNT
#define BLH_RATING_CHINAINDEX BLH_DEBTRATECOUNT
#define BLH_RATING_CHINACREDIT BLH_DEBTRATECOUNT

#ifdef WIN32
#define LOCALCOPY(field,src)	strncpy_s(field,_countof(field),src?src:"",_TRUNCATE)
#else
#define LOCALCOPY(field,src)    strcpy(field,src?src:"")
#endif

typedef	struct	blh_condition_str	
{
    char	sCompanyid[32+1];	// 经纪公司ID，银行ID
    char	sDiffPrice[16];		// BP差
	UINT	nYieldOrPrice;		// 净价或收益率
	UINT	nValid;				// 有报价，包括有效报价，referred报价，有价无量报价
    UINT	nBothFlg;			// 双边
	UINT	nBidValid;			// BidValid
	UINT	nOfrValid;			// OfrValid
    UINT	nNewFlg;			// 新上市
    UINT	nHasFlg;			// 有效报价 1，-有效报价，0--所有
	UINT	nMatFlg;			// 1 不显示已到期， 0 显示已到期
    UINT	nASemi;				// 一级半，新发债
    UINT	nMortgt;			// 可质押
    UINT	nCrosmk;			// 跨市场
    UINT	nEntrTyp;			// 国企
	UINT	nBpcCnd;			// bid比较标志 ，0 表示 [<=] , 1 表示 [>=]
	UINT	nOpcCnd;			// ofr比较标志 ，0 表示 [<=] , 1 表示 [>=]
	UINT	nBnkFlg;			// 已废弃   //////0=现券报价（二级），2=海外版中间价, （1=已废弃，银行报价）
	UINT	nOffset;			// 估值偏差
	UINT	nBkClnt;			// 已废弃   //////0 = 报价端， 1 = 接收端
	UINT    nUniqueBond;		//0:相同债券全部显示，1：跨市场债券只显示一条记录，展示优先级为CIB > SSE > SZE；
	UINT    nQuoteFilterType;	//0: 收益率 , 1: 净价

	//UINT	nOldWarrant;				// CBondContainer::WarrantTypes 旧版本是否担保，兼容旧版本数据
    UINT	nWarrant[BLH_WARRANTCOUNT];	// CBondContainer::WarrantTypes 担保人，担保物，其它
    UINT	nRight;				// CBondContainer::RightTypes   是否含权
	UINT	nRightEx[10];		// 含权，细分类型

	UINT    nETSBond[BLH_WARRANTCOUNT];			//永续债: 永续、非续债
	UINT    nCorpBond[BLH_WARRANTCOUNT];		//公司债: 公募，私募

	UINT    nPlatform[BLH_WARRANTCOUNT];		//平台 ： 全部 省级 市级 区县级  其他
	UINT    nLocalBond[BLH_WARRANTCOUNT];		//地方债: 一般债 专项债
	UINT    nNCDRating[BLH_WARRANTCOUNT];		// add  by lbl   NCD  
	UINT	nOldMunicp;					// CBondContainer::MunicpTypes  城投 旧版本,兼容旧版本数据
	UINT	nMunicp[BLH_WARRANTCOUNT];	// CBondContainer::MunicpTypes  城投
	UINT	nInterbank;			// 银行间
	UINT	nExchange;			// 交易所
	UINT	nSSE;				// 上交所
	UINT    nSZE;				// 深交所
	UINT	nBSE;				// 北交所
	UINT	nExpireInHoliday;	// 不含假期

//  UINT	nType[BLH_BONDTYPECOUNT];		// CBondContainer::BondsType	债券类型
 	UINT	nTypeNew[BLH_BONDTYPECOUNT];	// CBondContainer::BondsType	债券类型 ， //5.5.2 新增二级分类，平铺
    UINT	nRange[10];			// CBondContainer::DateRanges   剩余期限，CBondContainer::RangeOther 、 CBondContainer::RangeDate
	UINT	nDeadLineRange[10]; //	CBondContainer::DateLineRanges 期限
    UINT	nIssuerRating[10];	// CBondContainer::IssuerRating  主体评级
	UINT	nCouponType[10];	// CBondContainer::CouponTypes 票面
	UINT	nInstion[10];		// CBondContainer::InstionTypes 机构类型，企业
	UINT	nCommonUse[12];		// 常用
	UINT	nPopular[30];		// 热门概念
	UINT	nAssetStatus[10];	// 发行方式

	IssuerChar	szIssuer[BLH_ISSUERCOUNT];		// 发行人
	IssuerChar	szGuarantor[BLH_ISSUERCOUNT];	// 担保人
	SectorChar	szSector[BLH_SECTORCOUNT];		// 行业
	SectorChar	szSector2021[BLH_SECTORCOUNT];		// 2021版申万行业
	AreaChar	szArea[BLH_AREACOUNT];			// 地区
	AreaChar	szCategoryFlag[BLH_ISSUEYEARCOUNT];	// 专项债
	MuniAreaChar szMuniArea[BLH_MUNIAREACOUNT];	// 城投地区
	SubTypeChar szSubType[BLH_SUBTYPECOUNT];	// 债券子类型
	MuniAreaChar szLocalBondArea[BLH_LOCALBONDAREACOUNT];		// 地方债地区
	UINT		nDebtRating[BLH_DEBTRATECOUNT];	// CBondContainer::DebtRating  债项评级
	UINT		nFinDebt[BLH_FINDEBTCOUNT];		// CBondContainer::FinDebt		金融债
	UINT		nIssueYear[BLH_ISSUEYEARCOUNT];	// 发行年份	

	//2019/07/23 by devin.zhang:增加中债隐含评级、中证隐含评级、中债资信评级
	UINT		nCDCRating[BLH_RATING_CHINABOND];			//CBondContainer::CDCRating 中债隐含评级
	UINT		nCSIRating[BLH_RATING_CHINAINDEX];			//CBondContainer::CSIRating 中证隐含评级
	UINT		nCBRRating[BLH_RATING_CHINACREDIT];			//CBondContainer::CBRRating 中债资信评级

	//2019/11/26 by devin.zhang:增加展望评级
	UINT		nOutlookRating[BLH_RATING_OUTLOOK];			//CBondContainer::OutlookRating 展望评级

	//-------------------------------------------宏源 by devin
	UINT	nStateType;			// 0=全部，1=今日簿记建档，2=当日发行，3=当日公告
	//UINT	nUnderwriter;		// 宏源在团	0=全部，1=宏源在团
	char	szIssueDateB[12];		//发行日期
	char	szIssueDateE[12];
	char	szUnderwriter[10];
	//-------------------------------------------宏源 by devin

	UINT	nBrokId[8];			//经纪商ID的int转化数组,最多7个,以00结尾
    char	sBPrice[8];			//bid->begin
	char	sBPriceEnd[8];		//bid->End
    char	sOPrice[8];			//ofr->begin
	char	sOPriceEnd[8];		//ofr->end
    char	sDate1[32];			//剩余期限，对应 CBondContainer::RangeOther 、 CBondContainer::RangeDate
    char	sDate2[32];			//剩余期限，对应 CBondContainer::RangeOther 、 CBondContainer::RangeDate
	char	sMTDate1[32];		//期限，对应CBondContainer::DL_RangeDate
	char	sMTDate2[32];		//期限，对应CBondContainer::DL_RangeDate

	///////////////////////////////////////////////////////////////////
	UINT	nDaysDelRefer;			//refer报价多少天后删除
	BYTE	bDiff2CDC[9];			//估值价偏移，1 = 是， 0 = 否
	char	sDiff2CDC[9][9];		//估值价偏移量 added by lance 03 July 2014
	///////////////////////////////////////////////////////////////////

	//债券发行相关
	UINT	nCreditBond;				// 0=全部，1=信用债 2=利率债 5=PPN
	int		nIssueStartDate[2];			//发行 时间格式:yyyymmdd
	int		nAnnounceDate[2];			//公告 时间格式:yyyymmdd
	int		nPaymentDate[2];			//缴款 时间格式:yyyymmdd
	int		nListedDate[2];				//上市 时间格式:yyyymmdd
	int     nInterestStartDate[2];		//起息 时间格式:yyyymmdd
	UINT	nIssueState;				//0=不限，1：预发行（募集时段有值的债券），2：已发行（票面利率有值的债券），3：	发行中(除了“预发行”、“已发行”以外的债券)	

	//ABS
	UINT	nABSCommonUse[10];					//ABS常用
	short	nABSIssueBegin;
	short	nABSIssueEnd;
	UINT	nABSBaseType[20];					//ABS基础资产
	UINT	nABSTrancheClass[10];				//ABS产品结构
	UINT	nABSCoupon[20];						//ABS票面
	ABSSeriesNameChar	szABSSeries[200];		//ABS系列
	IssuerChar	szABSFinancier[BLH_ISSUERCOUNT];	//ABS实际融资人人
	IssuerChar	szABSIssuer[BLH_ISSUERCOUNT];	//ABS发行人
	IssuerChar	szMainUnderwriter[200];			//主承机构

	//交易所
	UINT	nVolBpcCnd;			// vol.bid比较标志 ，0 表示 [<=] , 1 表示 [>=]
	UINT	nVolOpcCnd;			// vol.ofr比较标志 ，0 表示 [<=] , 1 表示 [>=]
	char	sVolBid[18];		// vol.bid
	char	sVolOfr[18];		// vol.ofr
//	int		nExchangeType;		//交易所 0全部，1上交所，2深交所
	UINT	nListedPlace[5];	// 上市场所
	UINT	nMarketMakeTarget[5];	//做市标的

	//bid-ofr
	char	sBidOfr[18];		//bid-ofr
	char	sBidOfrEnd[18];

	char	sCdcValue[18];		//中债估值
	char	sCdcValueEnd[18];
	//bid-中债 中债-ofr
	char	sBidCdc[18];		// bid-中债
	char	sBidCdcEnd[18];
	char	sCdcOfr[18];		// 中债-ofr
	char	sCdcOfrEnd[18];

	char	sCouponRate[18];	//票面利率
	char	sCouponRateEnd[18];

	int		nCFETSQuoteType;	// CFETS报价类型，--1=无效，0=最优报价，1=做市商报价，2=X-BOND报价

	int		nDealType[5];		// 成交类型， 0=全部，1=tkn，2=gvn，3=trd，4=N.D
	int     nSubOrdinate[3];	// 次级债, 0= 全部 1= 次级债 2= 非次级债
	int		nBankBond[5];		// 银行业, 0= 全部 1= 国有行 2= 股份制 3= 城商行 4=其他
	bool	m_bFilterConditon;//是否是我的方案
	int		nSettlement[4];		//清算速度，1=不限, 2=T+0, 3=T+1, 4=远期, 5=非远期
	UINT	nQuotePriceType[3];		//报价类型，0=全部，1=实盘，2=可部分执行，3=意向价
	int		nQuoteType[4];		//报价类型
	char	sBondLiquidity[10];		//债券流动性评分
	char	sIssuerLiquidity[10];	//主体流动性评分
	int		nPrincipalPayType[3];//偿还方式 1=全部  2=提前还本 3=到期一次还本
	int		nHighYieldBond[3];//高收益债1=全部 2=高收益 3=非高收益
	UINT	nThirdPartyGuarantee[15];	//三方担保
    blh_condition_str()
    {
        memset(this, 0, sizeof(blh_condition_str));
		nTypeNew[0] = 1;
        nRange[0]	= 1;
		nDeadLineRange[0] = 1;
		nIssuerRating[0]	= 1;
		nCouponType[0] = 1;
		nInstion[0] = 1;
		nCommonUse[0] = 1;
		nPopular[0] = 1;
		nAssetStatus[0] = 1;
	//	nOldWarrant = 1;
        nWarrant[0]	= 1;
        //nMaturty	= 1;
        nRight		= 1;
		nRightEx[0] = 1;
		//nCmkTyp		= 1;
		nETSBond[0] = 1;
		nSubOrdinate[0] = 1;
		nBankBond[0] = 1;
		nCorpBond[0] = 1;
		nPlatform[0] = 1;
		nLocalBond[0] = 1;
		//   add by  lbl 
		nNCDRating[0] = 1;
		// end 
		nOldMunicp	= 1;
		nMunicp[0] = 1;
		nInterbank = 0;
		nExchange = 0;
		nSSE = 0;
		nSZE = 0;
		nBSE = 0;
		nExpireInHoliday = 0;
		nDaysDelRefer = 5;
		nDebtRating[0] = 1;
		nCDCRating[0] = 1;
		nCSIRating[0] = 1;
		nCBRRating[0] = 1;

		nOutlookRating[0] = 1;

		nFinDebt[0] = 1;
		nIssueYear[0] = 0;
		nCreditBond = 0;
		nIssueStartDate[0] = 0;
		nIssueStartDate[1] = 0;
		nAnnounceDate[0] = 0;
		nAnnounceDate[1] = 0;
		nPaymentDate[0] = 0;
		nPaymentDate[1] = 0;
		nListedDate[0] = 0;
		nListedDate[1] = 0;
		nInterestStartDate[0] = 0;
		nInterestStartDate[1] = 0;
		nUniqueBond = 0;
		nQuoteFilterType = 0;
		nIssueState = 0;
		
		nVolBpcCnd = 1;	//默认为">="
		nVolOpcCnd = 1;

		nExpireInHoliday = 0;

		nCFETSQuoteType = -1;

		m_bFilterConditon = false;
		nSettlement[0] = 1;
		nQuoteType[0] = 1;
		nPrincipalPayType[0] = 1;
		nHighYieldBond[0] = 1;

		nThirdPartyGuarantee[0] = 1;

		nListedPlace[0] = 1;
		nMarketMakeTarget[0] = 1;
    }
    bool operator ==(const blh_condition_str& stCond)const
    {
		if (strcmp(sCompanyid, stCond.sCompanyid) != 0 ||
			strcmp(sDiffPrice, stCond.sDiffPrice) != 0 ||
			strcmp(sBPrice, stCond.sBPrice) != 0 ||
			strcmp(sBPriceEnd, stCond.sBPriceEnd) != 0 ||
			strcmp(sOPrice, stCond.sOPrice) != 0 ||
			strcmp(sOPriceEnd, stCond.sOPriceEnd) != 0 ||
			strcmp(sDate1, stCond.sDate1) != 0 ||
			strcmp(sDate2, stCond.sDate2) != 0 ||
			strcmp(sMTDate1, stCond.sMTDate1) != 0 ||
			strcmp(sMTDate2, stCond.sMTDate2) != 0 ||
			nYieldOrPrice != stCond.nYieldOrPrice ||
			nValid != stCond.nValid ||
			nBothFlg != stCond.nBothFlg ||
			nBidValid != stCond.nBidValid ||
			nOfrValid != stCond.nOfrValid ||
			nEntrTyp != stCond.nEntrTyp ||
			nOffset != stCond.nOffset ||
			nBpcCnd != stCond.nBpcCnd ||
			nOpcCnd != stCond.nOpcCnd ||
			nNewFlg != stCond.nNewFlg ||
			nHasFlg != stCond.nHasFlg ||
			nMatFlg != stCond.nMatFlg ||
			nASemi != stCond.nASemi ||
			nMortgt != stCond.nMortgt ||
			nCrosmk != stCond.nCrosmk ||
			nRight != stCond.nRight ||
			//nCmkTyp != stCond.nCmkTyp ||
			nOldMunicp != stCond.nOldMunicp ||
			nInterbank != stCond.nInterbank ||
			nExchange != stCond.nExchange ||
			nSSE != stCond.nSSE ||
			nSZE != stCond.nSZE ||
			nBSE != stCond.nBSE ||
			nExpireInHoliday != stCond.nExpireInHoliday ||
		//	nOldWarrant != stCond.nOldWarrant ||
			nStateType != stCond.nStateType ||
			//nUnderwriter != stCond.nUnderwriter||
			strcmp(szIssueDateB, stCond.szIssueDateB) != 0 ||
			strcmp(szIssueDateE, stCond.szIssueDateE) != 0 ||
			strcmp(szUnderwriter, stCond.szUnderwriter) != 0 ||
			nCreditBond != stCond.nCreditBond ||
			nIssueStartDate[0] != stCond.nIssueStartDate[0] ||
			nIssueStartDate[1] != stCond.nIssueStartDate[1] ||
			nAnnounceDate[0] != stCond.nAnnounceDate[0] ||
			nAnnounceDate[1] != stCond.nAnnounceDate[1] ||
			nPaymentDate[0] != stCond.nPaymentDate[0] ||
			nPaymentDate[1] != stCond.nPaymentDate[1] ||
			nListedDate[0] != stCond.nListedDate[0] ||
			nListedDate[1] != stCond.nListedDate[1] ||
			nInterestStartDate[0] != stCond.nInterestStartDate[0] ||
			nInterestStartDate[1] != stCond.nInterestStartDate[1] ||
			nUniqueBond != stCond.nUniqueBond ||
			nQuoteFilterType != stCond.nQuoteFilterType ||
			nIssueState != stCond.nIssueState ||
			nABSIssueBegin != stCond.nABSIssueBegin ||
			nABSIssueEnd != stCond.nABSIssueEnd ||
			nVolBpcCnd != stCond.nVolBpcCnd ||
			nVolOpcCnd != stCond.nVolOpcCnd ||
			strcmp(sVolBid, stCond.sVolBid) != 0 ||
			strcmp(sVolOfr, stCond.sVolOfr) != 0 ||
		//	nExchangeType != stCond.nExchangeType ||
			strcmp(sBidOfr, stCond.sBidOfr) != 0 ||
			strcmp(sBidOfrEnd, stCond.sBidOfrEnd) != 0 ||
			strcmp(sBidCdc, stCond.sBidCdc) != 0 ||
			strcmp(sCdcValue, stCond.sCdcValue) != 0 ||
			strcmp(sCdcValueEnd, stCond.sCdcValueEnd) != 0 ||
			strcmp(sBidCdcEnd, stCond.sBidCdcEnd) != 0 ||
			strcmp(sCdcOfr, stCond.sCdcOfr) != 0 ||
			strcmp(sCdcOfrEnd, stCond.sCdcOfrEnd) != 0 ||
			strcmp(sCouponRate, stCond.sCouponRate) != 0 ||
			strcmp(sCouponRateEnd, stCond.sCouponRateEnd) != 0 ||
			nCFETSQuoteType != stCond.nCFETSQuoteType ||
			strcmp(sBondLiquidity, stCond.sBondLiquidity) != 0 ||
			strcmp(sIssuerLiquidity, stCond.sIssuerLiquidity)!=0)
        {
            return false;
        }
		for (int i = 0; i<BLH_BONDTYPECOUNT; i++)
        {
            if(nTypeNew[i] != stCond.nTypeNew[i]) return false;
        }
        for( int i=0; i<10; i++ )
        {
            if(	nRightEx[i] != stCond.nRightEx[i] || 
				nRange[i] != stCond.nRange[i] ||
				nIssuerRating[i] != stCond.nIssuerRating[i] ||
				nInstion[i] != stCond.nInstion[i] ||
				nCouponType[i] != stCond.nCouponType[i] ||
				nDeadLineRange[i] != stCond.nDeadLineRange[i] ||
				nCommonUse[i] != stCond.nCommonUse[i] ||
				nAssetStatus[i] != stCond.nAssetStatus[i])
            {
                return false;
            }
        }

		for(int i = 0; i < BLH_ISSUERCOUNT; i ++){
			if(szIssuer[i][0] == '\0' && stCond.szIssuer[i][0] == '\0')break;
			if(strcmp(szIssuer[i], stCond.szIssuer[i]) != 0)return false;
		}
		for (int i = 0; i < BLH_ISSUERCOUNT; i++) {
			if (szGuarantor[i][0] == '\0' && stCond.szGuarantor[i][0] == '\0')break;
			if (strcmp(szGuarantor[i], stCond.szGuarantor[i]) != 0)return false;
		}
		for(int i = 0; i < BLH_SECTORCOUNT; i ++){
			if(szSector[i][0] == '\0' && stCond.szSector[i][0] == '\0')break;
			if(strcmp(szSector[i], stCond.szSector[i]) != 0)return false;
		}
		for (int i = 0; i < BLH_SECTORCOUNT; i++) {
			if (szSector2021[i][0] == '\0' && stCond.szSector2021[i][0] == '\0')break;
			if (strcmp(szSector2021[i], stCond.szSector2021[i]) != 0)return false;
		}
		for(int i = 0; i < BLH_AREACOUNT; i ++){
			if(szArea[i][0] == '\0' && stCond.szArea[i][0] == '\0')break;
			if(strcmp(szArea[i], stCond.szArea[i]) != 0)return false;
		}
		for (int i = 0; i < BLH_MUNIAREACOUNT; i++) {
			if (szMuniArea[i][0] == '\0' && stCond.szMuniArea[i][0] == '\0')break;
			if (strcmp(szMuniArea[i], stCond.szMuniArea[i]) != 0)return false;
		}
		for (int i = 0; i < BLH_ISSUEYEARCOUNT; i++) {
			if (szCategoryFlag[i][0] == '\0' && stCond.szCategoryFlag[i][0] == '\0')break;
			if (strcmp(szCategoryFlag[i], stCond.szCategoryFlag[i]) != 0)return false;
		}
		for(int i = 0; i < BLH_SUBTYPECOUNT; i ++){
			if(szSubType[i][0] == '\0' && stCond.szSubType[i][0] == '\0')break;
			if(strcmp(szSubType[i], stCond.szSubType[i]) != 0)return false;
		}
		for (int i = 0; i < BLH_LOCALBONDAREACOUNT; i++) {
			if (szLocalBondArea[i][0] == '\0' && stCond.szLocalBondArea[i][0] == '\0')break;
			if (strcmp(szLocalBondArea[i], stCond.szLocalBondArea[i]) != 0)return false;
		}
		for(int i = 0;i < BLH_DEBTRATECOUNT; i ++){
			if(nDebtRating[i] == 1 && stCond.nDebtRating[i] == 1)break;
			if(nDebtRating[i] != stCond.nDebtRating[i])return false;
		}

		for (int i = 0; i < BLH_RATING_CHINABOND; i++){
			if (nCDCRating[i] == 1 && stCond.nCDCRating[i] == 1)break;
			if (nCDCRating[i] != stCond.nCDCRating[i])return false;
		}
		for (int i = 0; i < BLH_RATING_CHINAINDEX; i++){
			if (nCSIRating[i] == 1 && stCond.nCSIRating[i] == 1)break;
			if (nCSIRating[i] != stCond.nCSIRating[i])return false;
		}
		for (int i = 0; i < BLH_RATING_CHINACREDIT; i++){
			if (nCBRRating[i] == 1 && stCond.nCBRRating[i] == 1)break;
			if (nCBRRating[i] != stCond.nCBRRating[i])return false;
		}

		for (int i = 0; i < BLH_RATING_OUTLOOK; i++){
			if (nOutlookRating[i] == 1 && stCond.nOutlookRating[i] == 1)break;
			if (nOutlookRating[i] != stCond.nOutlookRating[i])return false;
		}

		for(int i = 0;i < BLH_FINDEBTCOUNT; i ++){
			if(nFinDebt[i] == 1 && stCond.nFinDebt[i] == 1)break;
			if(nFinDebt[i] != stCond.nFinDebt[i])return false;
		}
		for(int i = 0;i < BLH_ISSUEYEARCOUNT; i ++){
			if(nIssueYear[i] == 0 && stCond.nIssueYear[i] == 0)break;
			if(nIssueYear[i] != stCond.nIssueYear[i])return false;
		}

		for ( int i=0; i<BLH_WARRANTCOUNT; i++ )
		{
			if(nWarrant[i] == 0 && stCond.nWarrant[i] == 0)break;
			if(nWarrant[i] != stCond.nWarrant[i])return false;
		}

		for (int i = 0; i < sizeof(stCond.nPopular) / sizeof(int); i++)
		{
			if (nPopular[i] != stCond.nPopular[i])return false;
			if (nPopular[i] == 0)break;
		}

		for (int i = 0; i<BLH_WARRANTCOUNT; i++)
		{
			if (nETSBond[i] == 0 && stCond.nETSBond[i] == 0)break;
			if (nETSBond[i] != stCond.nETSBond[i])return false;
		}

		for (int i = 0; i < BLH_WARRANTCOUNT; i++)
		{
			if (nCorpBond[i] == 0 && stCond.nCorpBond[i] == 0)break;
			if (nCorpBond[i] != stCond.nCorpBond[i])return false;
		}

		for (int i = 0; i < BLH_WARRANTCOUNT; i++)
		{
			if (nPlatform[i] == 0 && stCond.nPlatform[i] == 0)break;
			if (nPlatform[i] != stCond.nPlatform[i])return false;
		}

		for (int i = 0; i < BLH_WARRANTCOUNT; i++)
		{
			if (nLocalBond[i] == 0 && stCond.nLocalBond[i] == 0)break;
			if (nLocalBond[i] != stCond.nLocalBond[i])return false;
		}		
		// NCD   add  by lbl 
		for (int i = 0; i < BLH_WARRANTCOUNT; i++)
		{
			if (nNCDRating[i] == 0 && stCond.nNCDRating[i] == 0)break;
			if (nNCDRating[i] != stCond.nNCDRating[i])return false;
		}
		//end 
		for (int i = 0; i < 4; i++)
		{
			if (nSettlement[i] == 0 && stCond.nSettlement[i] == 0)break;
			if (nSettlement[i] != stCond.nSettlement[i])return false;
		}
		for (int i = 0; i < 3; i++)
		{
			if (nQuotePriceType[i] != stCond.nQuotePriceType[i])return false;
		}

		for (int i = 0; i < 4; i++)
		{
			if (nQuoteType[i] == 0 && stCond.nQuoteType[i] == 0)break;
			if (nQuoteType[i] != stCond.nQuoteType[i])return false;
		}

		for (int i = 0; i < 3; i++) {
			if (nPrincipalPayType[i] == 0 && stCond.nPrincipalPayType[i] == 0)break;
			if (nPrincipalPayType[i] != stCond.nPrincipalPayType[i])return false;
		}

		for (int i = 0; i < 3; i++) {
			if (nHighYieldBond[i] == 0 && stCond.nHighYieldBond[i] == 0)break;
			if (nHighYieldBond[i] != stCond.nHighYieldBond[i])return false;
		}

		for (int i = 0; i < 3; i++)
		{
			if (nSubOrdinate[i] != stCond.nSubOrdinate[i])return false;
			if (nSubOrdinate[i] == 0)break;
		}

		for (int i = 0; i < 5; i++)
		{
			if (nBankBond[i] != stCond.nBankBond[i])return false;
			if (nBankBond[i] == 0)break;
		}

		for ( int i=0; i<BLH_WARRANTCOUNT; i++ )
		{
			if(nMunicp[i] == 0 && stCond.nMunicp[i] == 0)break;
			if(nMunicp[i] != stCond.nMunicp[i])return false;
		}
		for (int i = 0; i < 5; i++)
		{
			if (nDealType[i] == 0 && stCond.nDealType[i] == 0)break;
			if (nDealType[i] != stCond.nDealType[i])return false;
		}
		for (int i = 0; i < 10; i++)
		{
			if (nABSCommonUse[i] == 0 && stCond.nABSCommonUse[i] == 0)break;
			if (nABSCommonUse[i] != stCond.nABSCommonUse[i])return false;
		}
		for (int i = 0; i < 20; i++)
		{
			if (nABSBaseType[i] == 0 && stCond.nABSBaseType[i] == 0)break;
			if (nABSBaseType[i] != stCond.nABSBaseType[i])return false;
		}
		for (int i = 0; i < 10; i++)
		{
			if (nABSTrancheClass[i] == 0 && stCond.nABSTrancheClass[i] == 0)break;
			if (nABSTrancheClass[i] != stCond.nABSTrancheClass[i])return false;
		}
		for (int i = 0; i < 20; i++)
		{
			if (nABSCoupon[i] == 0 && stCond.nABSCoupon[i] == 0)break;
			if (nABSCoupon[i] != stCond.nABSCoupon[i])return false;
		}
		for (int i = 0; i < 200; i++)
		{
			if (szABSSeries[i][0] == '\0' && stCond.szABSSeries[i][0] == '\0')break;
			if (strcmp(szABSSeries[i], stCond.szABSSeries[i]) != 0)return false;
		}
		for (int i = 0; i < BLH_ISSUERCOUNT; i++)
		{
			if (szABSFinancier[i][0] == '\0' && stCond.szABSFinancier[i][0] == '\0')break;
			if (strcmp(szABSFinancier[i], stCond.szABSFinancier[i]) != 0)return false;
		}
		for (int i = 0; i < BLH_ISSUERCOUNT; i++)
		{
			if (szABSIssuer[i][0] == '\0' && stCond.szABSIssuer[i][0] == '\0')break;
			if (strcmp(szABSIssuer[i], stCond.szABSIssuer[i]) != 0)return false;
		}
		for (int i = 0; i < 200; i++)
		{
			if (szMainUnderwriter[i][0] == '\0' && stCond.szMainUnderwriter[i][0] == '\0')break;
			if (strcmp(szMainUnderwriter[i], stCond.szMainUnderwriter[i]) != 0)return false;			
		}
		for (int i = 0; i < 20; i++) {
			if (nThirdPartyGuarantee[i] != stCond.nThirdPartyGuarantee[i])return false;
			if (nThirdPartyGuarantee[i] == 0)break;
		}
		for (int i = 0; i < 5; i++)
		{
			if (nListedPlace[i] != stCond.nListedPlace[i])return false;
			if (nListedPlace[i] == 0)break;
		}
		for (int i = 0; i < 5; i++)
		{
			if (nMarketMakeTarget[i] != stCond.nMarketMakeTarget[i])return false;
			if (nMarketMakeTarget[i] == 0)break;
		}
        return true;
    }
	bool isAllin()const
	{
		blh_condition_str one;
		one.nMatFlg = 0;
		if(*this == one)return true;
		return false;
	}
	bool isEmptyCondition()const//我的方案空则无券
	{
		blh_condition_str stCond;
		stCond.nMatFlg = nMatFlg;
		stCond.nValid = nValid;
		
		LOCALCOPY(stCond.sCompanyid, sCompanyid);
		if (*this == stCond){
			return true;
		}
		return false;
	}
	bool IsPriceNeedShowFastCheck(bool checkSettlement = true) const
	{
		//IsPriceNeedShow的快速检查版本,只限于所有报价
		if (nHasFlg == 1 || nBothFlg == 1 || nBidValid == 1 || nOfrValid == 1)return false;//有效，双边，Bid，Ofr

		if (checkSettlement && nSettlement[0] != 1)return false;	//清算速度
		if (nQuotePriceType[0] != 0)return false; //报价类型

		if (sBPrice[0] != '\0' || sBPriceEnd[0] != '\0' //BidPrice
			|| sOPrice[0] != '\0' || sOPriceEnd[0] != '\0'	//OfrPrice
			|| sBidCdc[0] != '\0' || sBidCdcEnd[0] != '\0'	//Bid-CDC
			|| sCdcOfr[0] != '\0' || sCdcOfrEnd[0] != '\0'	//CDC-Ofr
			|| sBidOfr[0] != '\0' || sBidOfrEnd[0] != '\0'	//Bid-Ofr
			|| sVolBid[0] != '\0' || sVolOfr[0] != '\0')	//Vol.Bid Vol.Ofr
			return false;

		return true;
	}
	bool IsExchangePriceNeedShowFastCheck() const
	{
		//IsPriceNeedShow的快速检查版本,只限于所有报价
		if (nBothFlg == 1 || nBidValid == 1 || nOfrValid == 1)return false;//双边，Bid，Ofr

		if (sBPrice[0] != '\0' || sBPriceEnd[0] != '\0' //BidPrice
			|| sOPrice[0] != '\0' || sOPriceEnd[0] != '\0'	//OfrPrice
			|| sBidOfr[0] != '\0' || sBidOfrEnd[0] != '\0'	//Bid-Ofr
			|| sVolBid[0] != '\0' || sVolOfr[0] != '\0')	//Vol.Bid Vol.Ofr
			return false;

		return true;
	}
	std::string GetContributorId() const
	{
		std::string contributorId;
		switch (nSettlement[0])
		{
		case 1: contributorId = "SPBK"; break;
		case 2: contributorId = "SPBK0"; break;
		case 3: contributorId = "SPBK1"; break;
		case 4: contributorId = "SPBK2"; break;
		case 5: contributorId = "SPBK3"; break;
		default: break;
		}
		return contributorId;
	}
	static std::string GetContributorId(int comboxItem)
	{
		std::string contributorId;
		switch (comboxItem)
		{
		case 0: contributorId = "SPBK"; break;
		case 1: contributorId = "SPBK0"; break;
		case 2: contributorId = "SPBK1"; break;
		case 3: contributorId = "SPBK2"; break;
		case 4: contributorId = "SPBK3"; break;
		default: break;
		}
		return contributorId;
	}
}BLHCONDITION;

namespace FilterType {
	enum eFilterType
	{
		FilterType_Invalid = 0,			//
		FilterType_Condition = 1,	//过滤条件 
		FilterType_Bond,			//过滤“我的关注”
		FilterType_NONE,			//
		FilterType_Search,			//搜索
		FilterType_BondAndCondition,	//过滤条件+我的关注
		FilterType_Issuer,			//主体关注
	};
}

typedef struct tagBondsFilter
{
	int				m_nID;		// 根源来自CSSFilters::NewFilterID()
	FilterType::eFilterType		m_nFilterType; //1 使用关注条件 2 使用关注债券 6 主体关注
	char			m_sName[33];
	char			m_sConditionGroupId[33];
	char			m_sVersion[20];
	BLHCONDITION	stBlh;
	time_t			m_Time;
	int				m_nSortID;//方案排序id
	tagBondsFilter()
	{
		m_nID = 0;
		m_nFilterType = FilterType::FilterType_Invalid;
		memset(m_sName, 0, sizeof(m_sName));
		memset(m_sConditionGroupId, 0, sizeof(m_sConditionGroupId));
		memset(m_sVersion, 0, sizeof(m_sVersion));
		m_Time = 0;
		m_nSortID = -1;
	}
}BondsFilter;

//IRS
typedef struct _IRSDeeperQuoteInfo
{
	char		m_company_id[4];			//经纪公司ID',1,2,3,4
	char		m_company_name[32];			//经纪公司名称',
	char		m_status[4];				//1: 正常， 2: 删除(代表最优报价没有了，只有推送的时候会有2)
	char		m_agentCode[12];			//机构交易员代号（BCOM，...）
	char		m_bankName[32];				//机构代号（BCOM，...）
	char		m_flagInterested[8];		//兴趣价标记（true/false）
	char		m_flagSpdVolume[8];			//false:以久期匹配;true:以本金匹配
	char		m_price[12];				//价格
	char        m_prevPrice[12];			//refer之前的价格，当前价格被refer之后有效
	int			m_volume;					//量
	char		m_symbol[4];				//1: BID;  -1: OFR
	char		m_itemKey[128];				//拉宽方案，空则不处理
	int			m_version;					//从0开始，-1是无效值
	time_t		m_create_time;				//报价时间
	char        m_relation[8];              //good:好名字  bad:坏名字
	char        m_volumeDesc[4];            //量描述(N-normal, S-small, T-tiny)
	char        m_myprice[4];               //我的报价(0-normal, 1-unibest, 2-as well, 3-my normal)
	char        m_special[16];              //空-firm报价，非空-套算价格
	char        m_instituteId[33];          //机构Id
	_IRSDeeperQuoteInfo() :
		m_volume(0),
		m_version(0),
		m_create_time(0)
	{
		memset(m_company_id, 0, sizeof(m_company_id));
		memset(m_company_name, 0, sizeof(m_company_name));
		memset(m_status, 0, sizeof(m_status));
		memset(m_agentCode, 0, sizeof(m_agentCode));
		memset(m_bankName, 0, sizeof(m_bankName));
		memset(m_flagInterested, 0, sizeof(m_flagInterested));
		memset(m_flagSpdVolume, 0, sizeof(m_flagSpdVolume));
		memset(m_symbol, 0, sizeof(m_symbol));
		memset(m_relation, 0, sizeof(m_relation));
		memset(m_itemKey, 0, sizeof(m_itemKey));
		memset(m_volumeDesc, 0, sizeof(m_volumeDesc));
		memset(m_myprice, 0, sizeof(m_myprice));
		memset(m_special, 0, sizeof(m_special));
		memset(m_instituteId, 0, sizeof(m_instituteId));
		memset(m_price, 0, sizeof(m_price));
		memset(m_prevPrice, 0, sizeof(m_prevPrice));
	}
} IRSDeeperQuoteInfo;

typedef	struct _IRSRELEVANTUNIT{
    char		m_agentCode[12];		//	机构交易员代号（BCOM，...）
    char		m_bankName[32];			//	机构代号（BCOM，...）
    char		m_goodsCode[16];		//	产品方式(Outright, Spread等)
    char		m_typeName[32];			//	产品类型(REPO、DEPO等)
    char		m_termName[16];			//	期限(1Y,3Y,…)
    float		m_price;				//	价格
    int			m_volume;				//	量
    char		m_symbol[4];			//	1: BID;  -1: OFR

    _IRSRELEVANTUNIT()
		:m_price(0.0)
		,m_volume(0)
	{
		memset(m_agentCode, 0, sizeof(m_agentCode));
		memset(m_bankName, 0, sizeof(m_bankName));
		memset(m_goodsCode, 0, sizeof(m_goodsCode));
		memset(m_typeName, 0, sizeof(m_typeName));
		memset(m_termName, 0, sizeof(m_termName));
		memset(m_symbol, 0, sizeof(m_symbol));
    }
    bool operator == (const _IRSRELEVANTUNIT& stUnit) const
    {
        if(strcmp(m_typeName,stUnit.m_typeName)==0&&
            strcmp(m_termName,stUnit.m_termName)==0)
            return true;
        return false;
    }
}IRSRelevantUnit;

typedef	struct _IRSRELEVANTINFO{
    int			m_relevant_volume;					//m_relevantList 不为空则该值有效
    std::list<IRSRelevantUnit> m_relevantList;	//套算路径,如果没有套算路径，则list 为空
    _IRSRELEVANTINFO():m_relevant_volume(0)
    {
    }
}IRSRelevantInfo;

typedef	struct _IRSPIRCEUNIT{
    char		m_company_id[4];			//经纪公司ID',1,2,3,4
    char		m_company_name[32];			//经纪公司名称',
    char		m_goodsCode[16];			//产品方式(Outright, Spread,basis等)
    char		m_typeName[32];				//产品类型(REPO、DEPO等)
    char		m_termName[16];				//期限(1Y,3Y,…)
    char		m_status[4];				//1: 正常， 2: 删除(代表最优报价没有了，只有推送的时候会有2)
    char		m_agentCode[12];			//机构交易员代号（BCOM，...）
    char		m_bankName[32];				//机构代号（BCOM，...）
    char		m_flagInterested[8];		//兴趣价标记（true/false）
    char		m_flagSpdVolume[8];			//false:以久期匹配;true:以本金匹配
    char 		m_price[12];				//价格
    int			m_volume;					//量
    char		m_symbol[4];				//1: BID;  -1: OFR
    char		m_relation[8];				//good:好名字 bad:坏名字
    char        m_itemKey[128];                    //拉宽方案，空则不处理
    int			m_version;					//从0开始，-1是无效值
    time_t		m_create_time;				//报价时间
    char        m_volumeDesc[4];            //量描述(N-normal, S-small, T-tiny)
    char        m_myprice[4];               //我的报价(0-normal, 1-unibest, 2-as well, 3-my normal)
    char        m_special[12];              //空-firm报价，非空-套算价格
    char        m_instituteId[33];          //机构Id
    std::list<IRSRelevantInfo>	m_list;	//

    _IRSPIRCEUNIT():
        m_volume(0),
        m_version(0),
        m_create_time(0)
    {
        memset(m_company_id,0,sizeof(m_company_id));
        memset(m_company_name,0,sizeof(m_company_name));
        memset(m_goodsCode,0,sizeof(m_goodsCode));
        memset(m_typeName,0,sizeof(m_typeName));
        memset(m_termName,0,sizeof(m_termName));
        memset(m_status,0,sizeof(m_status));
        memset(m_agentCode,0,sizeof(m_agentCode));
        memset(m_bankName,0,sizeof(m_bankName));
        memset(m_flagInterested,0,sizeof(m_flagInterested));
        memset(m_flagSpdVolume,0,sizeof(m_flagSpdVolume));
        memset(m_symbol,0,sizeof(m_symbol));
        memset(m_relation,0,sizeof(m_relation));
		memset(m_itemKey, 0, sizeof(m_itemKey));
		memset(m_volumeDesc, 0, sizeof(m_volumeDesc));
		memset(m_myprice, 0, sizeof(m_myprice));
		memset(m_special, 0, sizeof(m_special));
        memset(m_instituteId, 0, sizeof(m_instituteId));
		memset(m_price, 0, sizeof(m_price));
    }

	_IRSPIRCEUNIT& operator=(const _IRSPIRCEUNIT& _value)
	{
		if (this != &_value){
			m_volume = _value.m_volume;
			m_version = _value.m_version;
			m_create_time = _value.m_create_time;
			LOCALCOPY(m_company_id, _value.m_company_id);
			LOCALCOPY(m_company_name, _value.m_company_name);
			LOCALCOPY(m_goodsCode, _value.m_goodsCode);
			LOCALCOPY(m_typeName, _value.m_typeName);
			LOCALCOPY(m_termName, _value.m_termName);
			LOCALCOPY(m_status, _value.m_status);
			LOCALCOPY(m_agentCode, _value.m_agentCode);
			LOCALCOPY(m_bankName, _value.m_bankName);
			LOCALCOPY(m_flagInterested, _value.m_flagInterested);
			LOCALCOPY(m_flagSpdVolume, _value.m_flagSpdVolume);
			LOCALCOPY(m_symbol, _value.m_symbol);
			LOCALCOPY(m_relation, _value.m_relation);
			LOCALCOPY(m_itemKey, _value.m_itemKey);
			LOCALCOPY(m_volumeDesc, _value.m_volumeDesc);
			LOCALCOPY(m_myprice, _value.m_myprice);
			LOCALCOPY(m_special, _value.m_special);
			LOCALCOPY(m_instituteId, _value.m_instituteId);
			LOCALCOPY(m_price, _value.m_price);
			m_list = _value.m_list;
		}
		return *this;
	}

	_IRSPIRCEUNIT(const _IRSPIRCEUNIT& _value)
	{
		*this = _value;
	}

}IRSPirceUnit;

typedef	struct _IRSPIRCEINFO{
    char		m_company_id[4];			//经纪公司ID',1,2,3,4
    char		m_goodsCode[16];			//产品方式(Outright, Spread,basis等)
    char		m_typeName[32];				//产品类型(REPO、DEPO等)
    char		m_termName[16];				//期限(1Y,3Y,…)
    std::list<IRSPirceUnit> m_BidList;		//Bid 列表
    std::list<IRSPirceUnit> m_OfrList;		//Ofr 列表

    _IRSPIRCEINFO()
    {
        memset(m_company_id,0,sizeof(m_company_id));
        memset(m_goodsCode,0,sizeof(m_goodsCode));
        memset(m_typeName,0,sizeof(m_typeName));
        memset(m_termName,0,sizeof(m_termName));
    }
    const bool operator < (const _IRSPIRCEINFO& obj);
    const bool operator ==(const _IRSPIRCEINFO obj);

}IRSPirceInfo;

typedef	struct _IRSTRENDINFO{
	int			m_brokerId;
	bool	    m_show_only_deal;

	_IRSTRENDINFO()
	{
		m_brokerId = 0;
		m_show_only_deal = false;
	}

}IRSTrendInfo;

typedef struct tagIRSTakenUnit
{
    char		m_id[32+1];					//UUID,唯一标识成交记录的UUID，用来更新和删除原记录
    char		m_company_id[4];			//经纪公司ID',1,2,3,4
    char		m_company_name[32];			//经纪公司名称'

    char		m_goodsCode[16];			//产品方式(Outright, Spread,basis等)
    char		m_typeName[32];				//产品类型(REPO、DEPO等)
    char		m_termName[16];				//期限(1Y,3Y,…)
    char		m_dealType[8];				//gvn/tkn/trd 成交方式

    char		m_method[12];				//ADD/UPDATE/DELETE, 标识成交记录的新增/更新/删除，和id字段配合用
    char		m_bidBankCode[12];			//买方银行代码(例如: BEA,CICC,ABC)
    char		m_ofrBankCode[12];			//卖方银行代码
	char		m_preClose[18];				//昨收盘，全市场成交收盘
    char		m_price[18];				//价格
    int			m_volume;					//量
    time_t		m_create_time;				//报价时间

    tagIRSTakenUnit()
		:m_volume(0)
		,m_create_time(0)
    {
		memset(m_id, 0, sizeof(m_id));
		memset(m_company_id, 0, sizeof(m_company_id));
		memset(m_company_name, 0, sizeof(m_company_name));
		memset(m_goodsCode, 0, sizeof(m_goodsCode));
		memset(m_typeName, 0, sizeof(m_typeName));
		memset(m_termName, 0, sizeof(m_termName));
		memset(m_dealType, 0, sizeof(m_dealType));
		memset(m_method, 0, sizeof(m_method));
		memset(m_bidBankCode, 0, sizeof(m_bidBankCode));
		memset(m_ofrBankCode, 0, sizeof(m_ofrBankCode));
		memset(m_preClose, 0, sizeof(m_preClose));
		memset(m_price, 0, sizeof(m_price));
    }
    void operator = (const tagIRSTakenUnit stUnit)
    {
        memcpy(m_id,stUnit.m_id,sizeof(m_id));
        memcpy(m_company_id,stUnit.m_company_id,sizeof(m_company_id));
        memcpy(m_company_name,stUnit.m_company_name,sizeof(m_company_name));
        memcpy(m_goodsCode,stUnit.m_goodsCode,sizeof(m_goodsCode));
        memcpy(m_typeName,stUnit.m_typeName,sizeof(m_typeName));
        memcpy(m_termName,stUnit.m_termName,sizeof(m_termName));

        memcpy(m_dealType,stUnit.m_dealType,sizeof(m_dealType));
        memcpy(m_method,stUnit.m_method,sizeof(m_method));
        memcpy(m_bidBankCode,stUnit.m_bidBankCode,sizeof(m_bidBankCode));
        memcpy(m_ofrBankCode,stUnit.m_ofrBankCode,sizeof(m_ofrBankCode));
		memcpy(m_preClose, stUnit.m_preClose, sizeof(m_preClose));
        memcpy(m_price,stUnit.m_price,sizeof(m_price));
        m_volume = stUnit.m_volume;
        m_create_time = stUnit.m_create_time;
    }
}IRSTakenUnit;

typedef struct tagIRSTakenInfo
{
    char  m_id[32+1];     //UUID,唯一标识成交记录的UUID，用来更新和删除原记录
    char		m_company_id[4];     //经纪公司ID',1,2,3,4
    char  m_goodsCode[16];     //产品方式(Outright, Spread,basis等)
    char  m_typeName[32];     //产品类型(REPO、DEPO等)
    char  m_termName[16];     //期限(1Y,3Y,…)
    IRSTakenUnit    m_stTaken;

    void TakenUnitToTakenInfo(const IRSTakenUnit& stUnit)
    {
        memcpy(m_id,stUnit.m_id,sizeof(m_id));
        memcpy(m_company_id,stUnit.m_company_id,sizeof(m_company_id));
        memcpy(m_goodsCode,stUnit.m_goodsCode,sizeof(m_goodsCode));
        memcpy(m_typeName,stUnit.m_typeName,sizeof(m_typeName));
        memcpy(m_termName,stUnit.m_termName,sizeof(m_termName));
        m_stTaken = stUnit;
    }
    bool operator == (const tagIRSTakenInfo& stInfo);

	bool operator < (const tagIRSTakenInfo& stInfo);
}IRSTakenInfo;

typedef struct tagIRSCurveInfo
{
	char		m_company_id[4];			//经纪公司ID',1,2,3,4
	int			m_nRateType;
	int			m_nInterpolation;
	tagIRSCurveInfo()
	{
		memset(m_company_id, 0, sizeof(m_company_id));
		m_nRateType = 0;
		m_nInterpolation = 0;
	}
}IRSCurveInfo;

typedef struct tagIRSComChartInfo
{
	char		m_company_id[4];			//经纪公司ID',1,2,3,4
	char		m_goodsCode[16];			//产品方式(Outright, Spread,basis等)
	char		m_typeName[32];				//产品类型(REPO、DEPO等)
	char		m_termName[16];				//期限(1Y,3Y,…)
	int			m_nBtnType;					//列表曲线选择
	int			m_nLineType;				//日线实时
	tagIRSComChartInfo()
	{
		memset(m_company_id, 0, sizeof(m_company_id));
		memset(m_goodsCode, 0, sizeof(m_goodsCode));
		memset(m_typeName, 0, sizeof(m_typeName));
		memset(m_termName, 0, sizeof(m_termName));
		m_nBtnType = 0;
		m_nLineType = 0;
	}
}IRSComChartInfo;
//IRSConfigure

//////////////////////////////////////////////////////////////////////////
enum ModeQuoteType
{
    ModeQuoteType_Null = 0,
    ModeQuoteType_Quote,
    ModeQuoteType_Taken
};

enum GlobalSetChange
{
    GlobalSet_BaseChange,
    GlobalSet_ProductChange
};
enum ModelQuote
{
    QuoteModelQuote_Null = -1,
    QuoteOutright_Repo = 0,
    QuoteOutright_Shibor,
	//QuoteOutright_6MShibor,
   // QuoteOutright_DepoA,
    //QuoteOutright_OIS,
	QuoteOutright_LPR1Y,
	QuoteOutright_LPR5Y,
    QuoteOutright_Other,

    QuoteSpread_Repo,
    QuoteSpread_Shibor,
	//QuoteSpread_6MShibor,
    //QuoteSpread_DepoA,
    //QuoteSpread_OIS,
	QuoteSpread_LPR1Y,
	QuoteSpread_LPR5Y,
    QuoteSpread_Other,

    QuoteBasis_ShiborRepo,
	//QuoteBasis_6MShiborShibor,
   // QuoteBasis_DepoRepo,
    //QuoteBasis_RepoOIS,
    QuoteBasis_Other,

    QuoteButterfly_Repo,
    QuoteButterfly_Shibor,
    QuoteButterfly_Other,

    QuoteBox_All,
    ModelQuote_Max
};


enum ModelQuoteOld
{
    Old_QuoteModelQuote_Null = -1,
	Old_QuoteOutright_Repo = 0,
	Old_QuoteOutright_Shibor,
    //QuoteOutright_6MShibor,
	Old_QuoteOutright_DepoA,
	Old_QuoteOutright_OIS,
	Old_QuoteOutright_LPR1Y,
	Old_QuoteOutright_Other,

	Old_QuoteSpread_Repo,
	Old_QuoteSpread_Shibor,
    //QuoteSpread_6MShibor,
	Old_QuoteSpread_DepoA,
	Old_QuoteSpread_OIS,
	Old_QuoteSpread_LPR1Y,
	Old_QuoteSpread_Other,

	Old_QuoteBasis_ShiborRepo,
    //QuoteBasis_6MShiborShibor,
	Old_QuoteBasis_DepoRepo,
	Old_QuoteBasis_RepoOIS,
	Old_QuoteBasis_Other,

	Old_QuoteButterfly_Repo,
	Old_QuoteButterfly_Shibor,
	Old_QuoteButterfly_Other,

	Old_QuoteBox_All,
	Old_ModelQuote_Max
};


enum ModelKeyPer
{
    ModelKeyNormal = 0,
    ModelKeyUpper,
    ModelKeyLower
};
typedef struct tagModeQuoteStruct
{
    ModelQuote      enModelQuote;

    tagModeQuoteStruct()
    {
        enModelQuote = QuoteModelQuote_Null;
    }
}ModeQuoteStruct;

//实时成交
typedef struct tagModeTakenStruct
{
    std::vector<ModelQuote> stlModelQuote;
    bool        m_bOutright;
    bool        m_bSpread;
    bool        m_bBasis;
    bool        m_bButterfly;
    bool        m_bBox;
    tagModeTakenStruct()
    {
        m_bOutright = false;
        m_bSpread = false;
        m_bBasis = false;
        m_bButterfly = false;
        m_bBox = false;
    }
}ModeTakenStruct;


//IRS设置 基本设置
typedef struct tagIRSGlobalBaseSet
{
    bool     bOnlyShowQuote;//Outright;
	bool     bShowBigNum;
	bool     bShowBigNumOther;//其他;
	bool     bShowDiscription;
	bool     bShowFloat;
    UINT      nShineTime;
    UINT      nLayOutRow;
    UINT      nLayOutColumn;
	
	bool      bGoodName;
	bool      bBadName;
	bool      bSmall;
	bool      bTiny;
	bool      bMyBest;
	bool      bUnMyBest;
	bool      bAsWell;
	bool      bAgstBas;
	bool      bByLegs;
	bool      bAgstSpd;

    tagIRSGlobalBaseSet()
    {
        bOnlyShowQuote = true;
		bShowBigNumOther = false;
        bShowBigNum = true;
        bShowDiscription = true;
        bShowFloat = true;
        nShineTime = 10;
        nLayOutRow = 2;
        nLayOutColumn = 3;

		bGoodName = true;
		bBadName = false;
		bSmall = true;
		bTiny = true;
		bMyBest = true;
		bUnMyBest = true;
		bAsWell = true;
		bAgstBas = true;
		bByLegs = true;
		bAgstSpd = true;
    }
}IRSGlobalBaseSet;

//IRS设置 产品

//类型
// enum emIRSGlobalType{
//     eIRS_Goods_Null = -1,
//     eIRS_Goods_Outright = 0,
//     eIRS_Goods_Spread,
//     eIRS_Goods_Basis,
//     eIRS_Goods_XBasis,
//     eIRS_Goods_Butterfly,
//     eIRS_Goods_Box,
//     eIRS_Goods_Num
// };

//产品
enum emIRSGlobalProduct{
    emGlobalProductNull = -1,
    emGlobalProductRepo = 0,
    emGlobalProductShibor,
	emGlobalProduct6MShibor,
    emGlobalProductDepo,
    emGlobalProductOis,
	emGlobalProductLPR1Y,
    emGlobalProductLPR5Y,
    emGlobalProductCcs,
    emGlobalProductLoan1Y,
    emGlobalProductLoan13,
    emGlobalProductLoan35Y,
    emGlobalProductLoan5YP,

    emGlobalProductShiborRepo,
    emGlobalProduct6MShiborShibor,
    emGlobalProductRepoOis,
    emGlobalProductDepoRepo,
    emGlobalProductRepoLPR,
    emGlobalProductShiborDepo,
    emGlobalProductDepoOis,
    emGlobalProductDepoLPR,
    emGlobalProductShiborOis,
    emGlobalProductShiborLPR,
    emGlobalProductOisLPR,
    emGlobalProductProductAll
};

emIRSGlobalProduct GetGetIRSGlobalProduct(int i,bool bAssociate = false);
//期限
enum emIRSGlobalRange
{
    em1M = 0x00000001L,
    em3M = 0x00000002L,
    em6M = 0x00000004L,
    em9M = 0x00000008L,
    em1Y = 0x00000010L,
    em2Y = 0x00000020L,
    em3Y = 0x00000040L,
    em4Y = 0x00000080L,
    em5Y = 0x00000100L,
    em7Y = 0x00000200L,
    em10Y = 0x00004000L,
    emNonStandard = 0x00008000L,
};

typedef struct tagIRSProductInfo
{
public:
    std::string     szCorpID;
    std::string     szGoods;
    std::string     szTypeName;
    std::string     szTerm;
public:
    bool operator ==(tagIRSProductInfo stInfo)
    {
        if(szGoods.compare(stInfo.szGoods)==0&&szTypeName.compare(stInfo.szTypeName)==0
            &&szTerm.compare(stInfo.szTerm)==0&&szCorpID.compare(stInfo.szCorpID)==0)
            return true;
        return false;
    }
}IRSProductInfo;
//排除产品

typedef struct tagIRSGlobalProductSet
{
    std::vector<IRSRelevantUnit>    stlExceptProduct;
}IRSGlobalProductSet;

typedef struct tagFilterCondition_Unit
{
public:
	tagFilterCondition_Unit()
	{
		m_nFilterFlag = -1;
		m_strFilter = "";
	}
public:
	int m_nFilterFlag;
    std::string m_strFilter;
}CnterFilterConditionUnit;

typedef struct tagCnterFilterCondition
{
public:
	tagCnterFilterCondition()
	{
		m_vFilterCondition.clear();
	}
public:
	std::vector<CnterFilterConditionUnit> m_vFilterCondition;
}CnterFilterCondition;

